package top.xiangqifu.springboot2.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import top.xiangqifu.springboot2.user.entity.TbUser;

import java.util.List;


@Mapper
public interface TbUserDAO extends BaseMapper<TbUser> {

    @Select("select * from tb_user where username=#{username}")
    public TbUser queryByName(String username);

    @Select("select * from tb_user where deleted=#{deleted}")
    public List<TbUser> queryDeleted(String deleted);

    @Update(" update tb_user set deleted = #{deleted} where uid = #{uid}")
    public int updateDeleted(TbUser user);


}
